﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
namespace XNAGame_Lab1
{
    public class MapFrame : MyXNAButton
    {
        string name;

        public string Name
        {
            get { return name; }
            set { name = value; }
        }
        public MapFrame(ContentManager content, List<string> strTexture, int nSprites, Vector2 topleft, Vector2 size,string name):base (content,strTexture,nSprites,topleft,size)
        {
            this.Sprites[0].State = 1;
            this.name = name;

        }
        public MapFrame(ContentManager content, string refix, int nSprites, Vector2 topleft, Vector2 size,string name)
            : base(content, refix, nSprites, topleft, size)
        {
            this.name = name;
            this.Sprites[0].State = 1;
            

        }
        public MapFrame(ContentManager content, string url)
        {

        }
        public override void UpdateImg(ContentManager content, string strTexture, int nSprites, Vector2 topleft, Vector2 size)
        {
            base.UpdateImg(content, strTexture, nSprites, topleft, size);
            this.Sprites[0].State = 1;

        }
        public event EventHandler Click;
        public override void Update(Microsoft.Xna.Framework.GameTime gameTime)
        {
            MouseState mouseSate = Mouse.GetState();

            if (mouseSate.LeftButton == ButtonState.Pressed)
            {
                Click(this, EventArgs.Empty);
            }
            base.Update(gameTime);
        }
    }
}
